<%@ page language="java" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
${aier_doctype}
<html <s:property value="aier_html_xmlns" escape="false"/>>
<head>
<meta http-equiv="Content-Type" content="${aier_content_type}" />
<title><s:property value="ev_title" /></title>
<meta name="keywords" content="${aier_keyworks}" />
<meta name="description" content="${aier_description}" />
<link href="${aier_css_url}jq/jq.css" rel="Stylesheet" />
<link rel="stylesheet" href="${aier_css_url}${aier_jqui_css}/ui.css" />
<link rel="stylesheet" href="${aier_css_url}social/module/jq-msg.css" />
<link rel="stylesheet" href="${aier_css_url}comm/text.css" />
<link rel="stylesheet" href="${aier_css_url}admin/admin.css" />

<script type="text/javascript" src="${aier_js_url}j.js"></script>
<script type="text/javascript" src="${aier_js_url}b.js"></script>
<script type="text/javascript" src="${aier_js_url}jp/msg.js"></script>
<script type="text/javascript" src="${aier_js_url}jp/1.js"></script>
<script type="text/javascript" src="${aier_js_url}lib/afu.js"></script>
<script type="text/javascript" src="${aier_js_url}jp/hh/ui.js"></script>
<script type="text/javascript" src="${aier_js_url}lib/block.js"></script>
<script type="text/javascript" src="${aier_js_url}lib/arrayList.js"></script>
<script type="text/javascript" src="${aier_js_url}97/WdatePicker.js"></script>
<script type="text/javascript" src="${aier_js_url}jc/cj.js"></script>
<script type="text/javascript" src="${aier_js_url}jq/jq.js"></script>
<script type="text/javascript" src="${aier_js_url}jq/cn.js"></script>
<script type="text/javascript" src="${aier_js_url}comm/text.js"></script>
</head>
<script type="text/javascript">
$(document).ready(function(){
    $("#schoolinfo").jqGrid({                
        url:'${aier_url}${aier_urijs}mcount_searchSchool${aier_suffix}',                
        datatype:"json",                
        mtype:'GET',
        height:'230',
        width:'960',              
        colNames:['学校名称','短信发送条数','sid'],                
        colModel:[                    
        {name:'name',index:'name',width:120,align:'center'},                    
        {name:'count',index:'count',width:120,align:'center'},
        {name:'sid',index:'sid',hidden : true}
        ],
        //autowidth:true,
        jsonReader: {
            root:"schoolList",
            page: "page",
            total: "page_count",
            records : "count",
            repeatitems: false
        },
        pager: jQuery("#schoolpage"),
        prmNames : {page:"page",sort: "sort"},
        rowNum: 10,
        sortname: 'sid',
        hidegrid: false,
        sortorder: 'asc',
        viewrecords: true,
        caption: '充值服务',
        gridComplete:function(){
            var ids=jQuery("#schoolinfo").jqGrid('getDataIDs');
            for(var i=0; i<ids.length; i++){
                var id=ids[i]; 
                jQuery("#schoolinfo").jqGrid('setRowData', ids[i]);
            }
        }
    }).navGrid("#schoolpage", { edit: false, add: false, del: false, search: false });
}); 
</script>
<body style="background-color: #EEF2FB;">
    
    <div style="background-color: #EEF2FB;width: 100%;height: 700px; ">
       
         <div id="tabs">
             <ul>
                 <li><a href="#tabs-1">短信发送管理</a></li>
             </ul>
             <div id="tabs-1" style="height: 500px;">
                 <div class="d_content">
                    <div class="d_scnOut">
                        <div class="d_scname">
                            <label for="name">学校地址:</label>
                        </div>
                        <div class="sel_region">
                            <s:action name="cityutil" namespace="/common"
                                executeResult="true">
                                <s:param name="cityid">-1</s:param>
                            </s:action>
                        </div>
                    </div>
                    <div class="d_scnOut">
                        <div class="d_scname" style="margin-left: 0px;">
                            <label for="name">学校名称: </label>
                        </div>
                        <div class="d_sctext">
                            <input type="text" id="sname" />
                        </div>
                    </div>
                    <div class="d_scnOut">
                        <div class="d_scname" style="margin-left: 0px;">
                            <label for="name">开始日期: </label>
                        </div>
                        <div class="d_sctext">
                            <input type="text" id="sdate" class="txt_scname"
                                            onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})"
                                            class="Wdate">
                        </div>
                    </div>
                    <div class="d_scnOut" style="margin-left: 300px;margin-top: -40px;">
                        <div class="d_scname" style="margin-left: 0px;">
                            <label for="name">结束日期: </label>
                        </div>
                        <div class="d_sctext">
                            <input type="text" id="edate" class="txt_scname"
                                            onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})"
                                            class="Wdate">
                        </div>
                    </div>
                    <div style="margin-left: 700px;margin-top: -47px;">
                        <button onclick="search();"
                            class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
                            role="button" aria-disabled="false">
                            <span class="ui-button-text">查询</span>
                        </button>
                    </div>
                    
                     <!-- 表格 -->
                     <div style="margin-left: 0px;margin-top: 0px;">
                         <table id="schoolinfo"></table>
                         <div id="schoolpage"></div>
                     </div>
                            
				</div>
				
			</div>
        </div>
	</div>

	<script type="text/javascript">
		$("#tabs").tabs();
		var sid;
	
	   // 根据条件查询学校列表 
	   function search(){
	      var pcid = -1;
	      if(acity.cid>-1){
	         pcid = acity.cid;
	      }
	      jQuery("#schoolinfo").jqGrid('setGridParam',{url:'${aier_url}${aier_urijs}mcount_searchSchool${aier_suffix}'+"?cid="+pcid+"&sname="+$("#sname").val()+"&sdate="+$("#sdate").val()+"&edate="+$("#edate").val(),page:1}).trigger("reloadGrid");
	   }
     
	</script>
</body>
</html>